package com.foxchen.ddns.service.impl;

import com.foxchen.ddns.config.DDNSConfig;
import com.foxchen.ddns.service.DomainUpdateDnsService;
import lombok.extern.slf4j.Slf4j;


@Slf4j
public abstract class DomainUpdateDnsServiceAbs implements DomainUpdateDnsService {

    @Override
    public void updateDns(String domain, DDNSConfig.Detail detail) {
        try {
            updateDnsSafe(domain, detail);
        } catch (Exception e) {
            log.error("domain:{} => update dns error", domain, e);
        }
    }

    abstract void updateDnsSafe(String domain, DDNSConfig.Detail detail) throws Exception;
}
